Video embedding tutorial.
Hello, this is a very simple tutorial on how to embed a video in an html(5) file.
- First, you have to establish your HTML5 video player with the video tag. Add width and height if needed (You can ad only one of
these properties and your video will adjust to it).
- Then, set your video file's location (the file's name) and media type inside of the source tag.
- Now you can add preload values or boolean attributes.
Preload values:
- auto
- The default setting. The browser will download the entire file or part of it.
- metadata
- Only some basic information such as the file's time length will be downloaded to give it to the user.
- none
- The browser will not download any of the file and the user will have to click it to start download process.
Boolean attributes:
- autoplay
- The video player will play the video once the data is loaded. This sets the preload attribute to auto.
- controls
- Displays the player's video controls.
- loop
- The video will replay once it reaches the end.
- muted
- The video will initially be set to mute.
- Now, you can finally close your video tag!
Home